# 浏览器前进后退
from selenium import webdriver
import time
driver = webdriver.Chrome()
driver.get("https://www.baidu.com/")
driver.find_element_by_id("kw").send_keys("龙猫")
driver.find_element_by_id("su").click()
time.sleep(3)
# 后退
driver.back()
time.sleep(3)
# 前进
driver.forward()
time.sleep(3)
driver.quit()